// pages/webview/index.js
Page({
  data: {
    url: ''
  },
  onLoad(options) {
    if (options.url) {
      // 解码URL
      const decodedUrl = decodeURIComponent(options.url);
      this.setData({
        url: decodedUrl
      });
    } else {
      wx.showToast({
        title: '无效的链接',
        icon: 'none'
      });
      setTimeout(() => {
        wx.navigateBack();
      }, 1500);
    }
  }
})